<link href="./css/style.css" rel="stylesheet" type="text/css" />
<div class="main">
<div class="userlist">
	<p class="tt"><a>首页</a>><a href="userlist.php">会员管理</a>><span>会员列表</span>
	<span style=' float:right; padding-left:10px; padding-right:15px;'>今日新增激活 <font style='color:red; font-size:14px; font-weight;'> {$num4} </font></span>
	<span style=' float:right; padding-left:10px;'>今日新增注册 <font style='color:red; font-size:14px; font-weight;'> {$num3} </font></span>
	<span style=' float:right; padding-left:10px;'>购买激活数量 <font style='color:red; font-size:14px; font-weight;'> {$num2} </font></span>
	<span style=' float:right; padding-left:10px;'>全网注册数量 <font style='color:red; font-size:14px; font-weight;'> {$num1} </font></span>
	</p>
	<div class="div">
		<form class="search" action="?">
			<p><input type="text" name="uname" placeholder="请输入账户/姓名/手机号" value="{$uname}" /></p>			
			<p>
				<span>会员级别</span>
				<select name="level">
					<option {if($level==-1)} selected {/if} value="-1">-全部会员-</option>
					<option {if($level==0)} selected {/if} value="0">{$tdarr[0]}</option>
					<option {if($level==1)} selected {/if} value="1">{$tdarr[1]}</option>
					<option {if($level==2)} selected {/if} value="2">{$tdarr[2]}</option>
				</select>
			</p>
			<p>
				<span>团队级别</span>
				<select name="tlevel">
					<option {if($tlevel==0)} selected {/if} value="0">全部会员</option>
					<option {if($tlevel==1)} selected {/if} value="1">{$tdarr1[1]}</option>
					<option {if($tlevel==2)} selected {/if} value="2">{$tdarr1[2]}</option>
					<option {if($tlevel==3)} selected {/if} value="3">{$tdarr1[3]}</option>
					<option {if($tlevel==4)} selected {/if} value="4">{$tdarr1[4]}</option>
					<option {if($tlevel==5)} selected {/if} value="5">{$tdarr1[5]}</option>
					<option {if($tlevel==6)} selected {/if} value="6">{$tdarr1[6]}</option>
					<option {if($tlevel==7)} selected {/if} value="7">{$tdarr1[7]}</option>
				</select>
			</p>
			<p><input class="sousuo" type="submit" value="立即搜索" /></p>
			<a class="dc abtn2" style="width:auto; float:right;" href="excel.php?act=user&uname={$uname}&level={$level}&tlevel={$tlevel}" target="main">导出会员列表</a>
			<a class='abtn1' style='display:inline-block;float:none; ' href="?page={$page}&uname={$uname}&level={$level}&tlevel={$tlevel}">刷新</a>
		</form>
		
	</div>	
	<div class="list">
		{if($msg==0)}
		<p class='none'>未查询到资料</p>
		{else}
		<table>
			<tr class="after"><th>ID</th><th>账号</th><th>姓名</th><th>手机号</th><th>链动级别</th><th>团队级别</th><th>余额</th><th>收益</th><th>直推</th><th>团队人数</th><th>个人业绩</th><th>团队业绩</th><th>推荐人</th><th>{$tdarr[2]}</th><th>注册时间</th><th>状态</th><th>操作</th><th>授权登录</th></tr>
		{loop $list $k as $v}
			<tr class="remove">
				<td>{$v[Id]}</td>
				<td>{$v[uname]}</td>
				<td>{$v[tname]}</td>			
				<td>{$v[phone]}</td>
				<td>{$tdarr[$v[level]]}</td>	
				<td>{$tdarr1[$v[tlevel]]}</td>	
				<td>{$v[cash]}</td>
				<td>{$v[jjcash]}</td>		
				<td>{$v[ztnum]}</td>
				<td>{$v[teamnum]}</td>			
				<td>{$v[selforder]}</td>			
				<td>{$v[teamorder]}</td>			
				<td>{$v[tjname]}</td>
				<td>{$v[lbname]}</td>
				<td>{$v[addtime]}</td>
				
				
				<td>
					{if($v['state']==1)}
				    <a class='abtn2 state' style='display:inline-block;float:none; width:auto; cursor:pointer;' data-id="{$v[Id]}">正常</a>
				    {else}
				    <a class='abtn3 state' style='display:inline-block;float:none; width:auto; cursor:pointer; ' data-id="{$v[Id]}">冻结</a>
				    {/if}
				</td>
				<td>					
					<a class='abtn1' style='display:inline-block;float:none; ' href="useredit.php?act=edit&uid={$v[Id]}&page={$page}&uname={$uname}&level={$level}">编辑</a>					
				</td>
				<td><a class='abtn3' style='display:inline-block;float:none; width:auto; ' href='javascript:' onclick="login({$v[Id]})">登录会员中心</a></td>
			</tr>
		{/loop}
		</table>
		{$page1}
		{/if}
		

	<script src="./js/jquery.js"></script>
	<script>
		$(".hzlimit").on("click",function(){
			var e = $(this);
			var id = e.attr('data-id');
			$.ajax({
				type:"post",
				dataType:"json",
				url:"/Moudel.php?m=m&a=hzlimit",
				data:"id="+id,
				success:function(d){
					if(d[0]==0){
						alert(d[1]);
					}else{
						e.removeClass('abtn'+d[2]);
						e.addClass('abtn'+d[1]);
						e.html(d[3]);
					}
				}
			});
		});		
		
		$(".state").on("click",function(){
			var e = $(this);
			var id = e.attr('data-id');
			$.ajax({
				type:"post",
				dataType:"json",
				url:"/Moudel.php?m=m&a=state",
				data:"id="+id,
				success:function(d){
					if(d[0]==0){
						alert(d[1]);
					}else{
						e.removeClass('abtn'+d[1]);
						e.addClass('abtn'+d[2]);
						e.html(d[3]);
					}
				}
			});
		});	
		
		function login(id){
		$.ajax({
			type:"post",
			dataType:"json",
			url:"/Moudel.php?m=m&a=sqlogin",
			data:"uid="+id,
			success:function(d){
				if(d[0]==0){
					alert(d[1]);
				}
				else{						
					window.open("/user/");
				}
			}
		});
	}
		h1 = $(".main").height();
		h2 = $(".userlist").height();
		if(h2>h1){
			$(".main").css("height","auto");
		}
		$('tr').click(function(){	
			$('tr').removeClass('onactive');
			$(this).addClass('onactive');
		});
	</script>
	</div>
</div>
</div>